package benchmarkapplication;

import database.Database;
import entitydao.TableDAO;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

class QuerySet {

    List<TableDAO> mTableObjects;
    Database mDatabase;
    Random mRandom = new Random();

    public QuerySet(Database database) {
        mTableObjects = new ArrayList<TableDAO>();
        mDatabase = database;
    }

    public void AddTableObject(TableDAO tableObject) {
        mTableObjects.add(tableObject);
    }

    public TableDAO GetTableObject(ThreadTest thread) {
        int num = mRandom.nextInt(mTableObjects.size());
        thread.index = num;
        return mTableObjects.get(num);
    }

    public int GetTablesCount() {
        return mTableObjects.size();
    }
}
